<?php

namespace app\admin\controller;


class Price extends BaseController {
    public function index() {
        $price = model('Price')->get(1);
        return show(config('code.success'), 0, [
            'top_price'  => $price->top_price,
            'head_price' => $price->head_price
        ]);
    }

    public function save() {
        $data   = input('post.');
        $result = model('Price')->allowField(true)->save($data, ['id' => 1]);
        if (!$result) {
            return show(config('code.fail'), '修改价格失败');
        }
        return show(config('code.success'), '修改价格成功');
    }
}